<template>
	<view class="page">
		<view class="headCard">
			<view class="item">
				<view class="title">总收益</view>
			</view>
			<view class="item">
				<view class="sum">{{info.total_income}}</view>
				<view class="title">总值</view>
			</view>
			<view class="item">
				<view class="sum">{{info.today_total_income}}</view>
				<view class="title">今日收益</view>
			</view>
		</view>
		
		<view class="headCard">
			<view class="item" @click="onSkip(`/package/mine/myPoints/myPoints?type=0`)">
				<view class="title">权证收益</view>
			</view>
			<view class="item" @click="onSkip(`/package/mine/incomeDetailLog?logType=1`)">
				<view class="sum">{{info.qz_income}}</view>
				<view class="title">总值</view>
			</view>
			<view class="item" @click="onSkip(`/package/mine/incomeDetailLog?logType=11`)">
				<view class="sum">{{info.today_qz_income}}</view>
				<view class="title">今日收益</view>
			</view>
		</view>
		
		<view class="headCard">
			<view class="item">
				<view class="title">消费收益</view>
			</view>
			<view class="item" @click="onSkip(`/package/mine/incomeDetailLog?logType=2`)">
				<view class="sum">{{info.order_income}}</view>
				<view class="title">总值</view>
			</view>
			<view class="item" @click="onSkip(`/package/mine/incomeDetailLog?logType=21`)">
				<view class="sum">{{info.today_order_income}}</view>
				<view class="title">今日收益</view>
			</view>
		</view>
		
		<view class="headCard">
			<view class="item">
				<view class="title">推广收益</view>
			</view>
			<view class="item" @click="onSkip(`/package/mine/incomeDetailLog?logType=3`)">
				<view class="sum">{{info.tg_income_total}}</view>
				<view class="title">总值</view>
			</view>
			<view class="item" @click="onSkip(`/package/mine/incomeDetailLog?logType=31`)">
				<view class="sum">{{info.today_tg_income_total}}</view>
				<view class="title">今日收益</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import {
		getPersonalCenter,
	} from "../../api/index.js"
	export default {
		data() {
			return {
				bid: 0,
				info: {},
				list: [],
				pagenum: 1,
			}
		},
		async onLoad(opt) {
			this.bid = opt.bid;
			await this.getInfo();
		},
		onPullDownRefresh() {
			this.getInfo();

			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1000);
		},
		methods: {
			async getInfo() {
				const res = await getPersonalCenter('s=ApiZwyRequest/incomedetail', {}, true)
				const {
					data,
					status,
					msg
				} = res.data
				this.info = data;
				console.log(res)
			}
		}
	}
</script>

<style lang="less">
	page {
		background-color: #efefef;
	}

	.headCard {
		margin: 20rpx 5%;
		padding-top: 30rpx;
		padding-bottom: 30rpx;
		background-color: white;
		border-radius: 10px;
		display: flex;
		flex-direction: row;

		.item {
			flex: 1;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;

			.title {
				font-size: 24rpx;
				color: #333;
			}

			.sum {
				text-align: center;
				font-size: 28rpx;
				font-weight: bold;
				color: #774f9b;
				margin-bottom: 20rpx;
			}
		}
	}
</style>